package tech.aistar.corejava.day09.Stringextends;

/**
 * @author success
 * @version 1.0
 * @description:本类用来演示:
 * @date 2019/7/26 0026
 */
public class StringCompareDemo03 {
    public static void main(String[] args) {
        //常量池 "abc"
        //new 堆里面"abc"
        //s1 -> 堆里面"abc"
        String s1 = new String("abc");

        //则返回池中的字符串
        String s2 = s1.intern();

        String s3 = "abc";

        System.out.println(s1 == s3);//false

        System.out.println(s2 == s3);//true
    }
}
